package com.zzyl.common.utils;

import com.zzyl.common.utils.PDFUtil;
import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;

import java.io.FileInputStream;
import java.io.FileNotFoundException;

@Data
@Component
public class PDFUtilTest {

    @Autowired
    private  RedisTemplate<String,String> redisTemplate;
    public void result(String idCardNo) throws FileNotFoundException{

        FileInputStream fileInputStream = new FileInputStream("E:\\Java学习\\4.阶段四 中州养老（若依+AI版）\\2.第二章 中州养老\\资料\\中州养老-博学谷\\day08-智能评估-集成AI大模型\\资料\\体检报告样例\\体检报告-张芳-女-72岁.pdf");
        String content = PDFUtil.pdfToString(fileInputStream);
        redisTemplate.opsForHash().put("healthReport", idCardNo, content);
    }

    public static void main(String[] args) throws FileNotFoundException {

        FileInputStream fileInputStream = new FileInputStream("E:\\Java学习\\4.阶段四 中州养老（若依+AI版）\\2.第二章 中州养老\\资料\\中州养老-博学谷\\day08-智能评估-集成AI大模型\\资料\\体检报告样例\\体检报告-张芳-女-72岁.pdf");

        String result = PDFUtil.pdfToString(fileInputStream);

        System.out.println(result);
    }
}